import {createRouter, createWebHistory} from "vue-router";
import Login from "@/views/Login.vue";
import Layout from "@/views/Layout.vue";
import UserInfo from "@/views/user/UserInfo.vue";
import UserList from "@/views/user/UserList.vue";
import RestPassword from "@/views/user/RestPassword.vue";
import HouseManage from "@/views/house/HouseManage.vue";
import Index from "@/views/index/Index.vue";
import GroupManage from "@/views/group/GroupManage.vue";
import Square from "@/views/square/Square.vue";
import Approve from "@/views/approve/Approve.vue";
import Application from "@/views/application/Application.vue";
import Groupinfo from "@/views/group/Groupinfo.vue";
import Grouppeople from "@/views/group/Grouppeople.vue";
import MiddleSchool from "@/views/middleschool/MiddleSchool.vue";


import Pass from "@/views/application/Pass.vue";
import underPass from "@/views/application/Under approval.vue";
import unPass from "@/views/application/not passed.vue";
import ViewDetails from "@/views/square/viewDetails.vue";
import ViewSchool from "@/views/square/viewSchool.vue";
import Activity from "@/views/approve/activity.vue";
import MiddleShow from "@/views/middleschool/MiddleShow.vue";
import Kaojuan from "@/views/house/kaojuan.vue";

// 定义路由关系
const routes = [
  {path: '/login', component: Login},  // 一级路由
  {
    path: '/',
    redirect: '/login',  // 重定向
    component: Layout,
    // 子路由
    children: [
      {path: '/index', component: Index},
      {path: '/user/list', component: UserList},
      {path: '/user/info', component: UserInfo},
      {path: '/user/resetPassword', component: RestPassword},
      {path: '/house/list', component: HouseManage},
      {path: '/group/list', component: GroupManage},
      {path: '/group/info', component: Groupinfo},
      {path: '/group/list2', component: Grouppeople},
      {path: '/middleschool/list', component: MiddleSchool},
      {path: '/middleshow/list', component: MiddleShow},
      {path: '/square/list', component: Square},
      {path: '/approve/list', component: Approve},
      {path: '/application/list', component: Application},
      {path: '/application/pass', component: Pass},
      {path: '/application/underpass', component: underPass},
      {path: '/application/unpass', component: unPass},
      {path: '/square/viewDetails',component: ViewDetails},
      {path: '/square/viewSchool',component: ViewSchool},
      {path:'/approve/activity',component: Activity},
      {path:'/kaojuan/list',component: Kaojuan}

    ]
  },
]

// 创建路由器
const router = createRouter({
  history: createWebHistory(), // 路由模式
  routes: routes
})

//导出暴露
export default router
